package cate.common.table.res.sign;

import cate.common.table.EExcel;
import cate.common.table.ESheet;
import cate.common.table.res.sign.addup.DailySignAddUpRow;
import cate.common.table.res.sign.addup.DailySignAddUpSheet;
import cate.common.table.res.sign.common.DailySignCommonSheet;
import cate.common.table.res.sign.item.DailySignItemSheet;
import easy.java.dev.note.NoteClass;
import easy.java.dev.note.NoteField;

@NoteClass("每日签到 Excel")
public class ActDailySignExcel extends EExcel {
    @NoteField("每日签到基础配置")
    public DailySignCommonSheet common = new DailySignCommonSheet();
    @NoteField("每日签到奖励配置")
    public DailySignItemSheet item = new DailySignItemSheet();
    @NoteField("每日签到累计配置")
    public DailySignAddUpSheet addUp = new DailySignAddUpSheet();

    @Override
    public String getFileName() {
        return "签到.xlsx";
    }

    @Override
    public ESheet<?>[] getSheets() {
        return new ESheet[]{common, item, addUp};
    }

    /**
     * 获取最大累计签到需求次数
     *
     * @return 最大次数
     */
    public int getMaxAddUpSignTimes() {
        int max_times = 0;
        for (DailySignAddUpRow configRow : addUp.getList()) {
            if (configRow.needSignTimes > max_times) {
                max_times = configRow.needSignTimes;
            }
        }
        return max_times;
    }
}
